package com.iot.fire.controller;

import com.iot.fire.netty.NettyServerHandler;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;


@Slf4j
@RestController
@CrossOrigin
@RequiredArgsConstructor
@RequestMapping("/device/status")
public class DeviceController {

    @GetMapping("/OnlineStatus/{deviceNo}")
    public boolean OnlineStatus(@PathVariable String deviceNo) {
        return NettyServerHandler.isDeviceConnected(deviceNo);
    }
}
